home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / games / nhak_src.zip / PCTTY.C < prev    next >
C/C++ Source or Header  |  1993-03-16  |  1KB  |  53 lines

  1. /*    SCCS Id: @(#)pctty.c    3.0    87/05/03
  2. /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  3. /* NetHack may be freely redistributed.  See license for details. */
  4. /* tty.c - (PC) version */
  5.  
  6. #define NEED_VARARGS /* Uses ... */    /* comment line for pre-compiled headers */
  7. #include "hack.h"
  8.  
  9. char erase_char, kill_char;
  10.  
  11. /*
  12.  * Get initial state of terminal, set ospeed (for termcap routines)
  13.  * and switch off tab expansion if necessary.
  14.  * Called by startup() in termcap.c and after returning from ! or ^Z
  15.  */
  16. void
  17. gettty(){
  18.     erase_char = '\b';
  19.     kill_char = 21;        /* cntl-U */
  20.     flags.cbreak = TRUE;
  21. #if !defined(TOS) && !defined(MACOS)
  22.     disable_ctrlP();    /* turn off ^P processing */
  23. #endif
  24. }
  25.  
  26. /* reset terminal to original state */
  27. void
  28. settty(s)
  29. const char *s;
  30. {
  31.     end_screen();
  32.     if(s) Printf(s);
  33.     (void) fflush(stdout);
  34. #if !defined(TOS) && !defined(MACOS)
  35.     enable_ctrlP();        /* turn on ^P processing */
  36. #endif
  37. }
  38.  
  39. /* fatal error */
  40. /*VARARGS1*/
  41.  
  42. void
  43. error VA_DECL(const char *,s)
  44.     VA_START(s);
  45.     VA_INIT(s, const char *);
  46.     end_screen();
  47.     putchar('\n');
  48.     Vprintf(s,VA_ARGS);
  49.     putchar('\n');
  50.     VA_END();
  51.     exit(1);
  52. }
  53.